﻿@model Model.News.E_tb_ElectronicsMagazine
@{
    ViewBag.Title = "MagazineEdit";
}

<!DOCTYPE html>

<head>
    <meta name="viewport" content="width=device-width" />
    <title>图片信息</title>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/default/easyui.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/themes/icon.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/jquery-easyui/demo.css")'/>
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/uploader/uploadify.css")' />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Scripts/Validform/style.css")'  />
    <link rel="stylesheet" type="text/css" href='@Url.Content("~/Content/XINDECSS/MainStyle.css")'/>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-1.8.2.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/jquery.easyui.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery-easyui/locale/easyui-lang-zh_CN.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/jquery.uploadify.min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/uploader/swfobject.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/jquery.unobtrusive-ajax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/MicrosoftMvcAjax.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/Validform/Validform_v5.3.2_min.js")'></script>
    <script type="text/javascript" src='@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js")'></script>
</head>
<body>
        @using (Ajax.BeginForm("Save", "Magazine", new AjaxOptions { HttpMethod = "Post", OnSuccess = "handle", OnFailure = "failed" }, new { @id = "frmUpdate" }))
        {
            @Html.HiddenFor(m => m.MagazineID, new { @id = "HidMagazineID" })
            @Html.HiddenFor(m => m.EditType, new { @id = "HidEditType" })
            <table border="0" cellpadding="0" cellspacing="0" width="98%" class="DialogTable">
                <tr>
                    <td width="70px" align="right">杂志名称：</td>
                    <td align="left" style="width:160px;">@Html.TextBoxFor(m => m.MagazineName, new { @style = "width:99%;", @id = "txt_MagazineName" })</td>
                    <td width="70px" align="right">杂志类型：</td>
                    <td align="left">@Html.DropDownListFor(m => m.MagazineTypeID, ViewData["MagazineTypeList"] as SelectList)</td>
                </tr>
                <tr>
                    <td align="right">封面：</td>
                    <td>@Html.TextBoxFor(m => m.ImgPath, new { @style = "width:99%;", @id = "txt_ImgPath" })</td>
                    <td colspan="2" align="left">&nbsp;&nbsp;<input type="text" id="uploadify" /></td>
                </tr>
                <tr>
                    <td align="right">文件(<span style="color:Red; font-weight:bold;">PDF</span>)：</td>
                    <td align="left">@Html.TextBoxFor(m => m.FliePath, new { @style = "width:99%;", @id = "txt_FilePath" })</td>
                    <td colspan="2" align="left">&nbsp;&nbsp;<input type="text" id="uploadify_File" /></td>
                </tr>
                <tr>
                    <td colspan="4" align="center">
                        <a href="javascript:void(0)" onclick="$('#frmUpdate').submit()"><img src="~/Content/Images/baocun.png" height="20px" /></a>
                        <a href="javascript:void(0)" onclick="Close()"><img src="~/Content/Images/quxiao.png" height="20px" /></a>
                    </td>
                </tr>
            </table>
        }

<!--图片上传-->
<script type="text/javascript">
    /*上传文件控件*/
    $("#uploadify").uploadify({
        'uploader': '@Url.Content("~/Scripts/uploader/uploadify.swf")',
        'script': '@Url.Action("Import", "ShowImage")',
        'cancelImg': '@Url.Content("~/Scripts/uploader/cancel.png")',
        'folder': 'UpFile',
        'queueID': 'fileQueue',
        'auto': false,
        'multi': false,
        'height': 20,
        'width': 75,
        'fileSizeLimit': '10240KB',
        'fileTypeDesc': '文档类型',
        'fileTypeExts': '*.doc;*.pdf;*.jpg;*.png;*.gif;*.bmp;*.*;',
        'buttonImg': '@Url.Content("~/Content/Images/daochuwenjian.png")',
        'onComplete': fun,
        'onSelect': function (e, queueId, fileObj) {
            $('#uploadify').uploadifyUpload();
        },
        'onCancel': function (file) {
        }
    });
    /*结束 上传文件控件*/
    function fun(event, queueID, fileObj, response, data) {
        if (response == "false") {
            alert("文件上传出错！");
        }
        else {
            $('#txt_ImgPath').val(response);
            alert("成功上传！");
        }
    }
    </script>

<!--文件上传-->
<script type="text/javascript">
    /*上传文件控件*/
    $("#uploadify_File").uploadify({
        'uploader': '@Url.Content("~/Scripts/uploader/uploadify.swf")',
        'script': '@Url.Action("Import", "ShowImage")',
        'cancelImg': '@Url.Content("~/Scripts/uploader/cancel.png")',
        'folder': 'UpFile',
        'queueID': 'fileQueue',
        'auto': false,
        'multi': false,
        'height': 20,
        'width': 75,
        'fileSizeLimit': '10240KB',
        'fileTypeDesc': '文档类型',
        'fileTypeExts': '*.doc;*.pdf;*.jpg;*.png;*.gif;*.bmp;*.*;',
        'buttonImg': '@Url.Content("~/Content/Images/daochuwenjian.png")',
        'onComplete': funFile,
        'onSelect': function (e, queueId, fileObj) {
            $('#uploadify_File').uploadifyUpload();
        },
        'onCancel': function (file) {
        }
    });
    /*结束 上传文件控件*/
    function funFile(event, queueID, fileObj, response, data) {
        if (response == "false") {
            alert("文件上传出错！");
        }
        else {
            $('#txt_FilePath').val(response);
            alert("成功上传！");
        }
    }
    </script>
</body>